/******************************************************************************
 * * inter_framework_interface.h - internal interface between framework and others
 *
 * *(C) Copyright 2019 ASR International Ltd.
 * * All Rights Reserved
 * ******************************************************************************/
#ifndef INTER_FRAMEWORK_INTERFACE_H
#define INTER_FRAMEWORK_INTERFACE_H

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
    IF_FRAMEWORK_INIT_NORMAL = 0,
    IF_FRAMEWORK_INIT_CHARGE,       /* Don`t read NVM,
                                     * initiate Alarm and Calendar modules,
                                     * get current battery when create charging interface,
                                     * handle battery ind,
                                     * send power off req to HAL upon receipt of charge ind(false)
                                     * RTC will call alarm callback function */
    IF_FRAMEWORK_INIT_ALARM,        /* Don`t read NVM,
                                     * initiate Alarm and Calendar module,
                                     * handle battery and charge ind,
                                     * RTC won`t call alarm callback function,
                                     * Alarm module considers the set alarm as timeout */
    IF_FRAMEWORK_INIT_SILENT_RESET, /* enter desktop ui without sim status ind */
} IF_FRAMEWORK_INIT_TYPE;

/**
 * Get initialization type
 * param (in) Type: IF_FRAMEWORK_INIT_TYPE
 * return  VOID
 */
extern IF_FRAMEWORK_INIT_TYPE Framework_Get_Init_Type(VOID);

/**
 * Initialize framework module
 * param (in) Type: IF_FRAMEWORK_INIT_TYPE
 * return  VOID
 */
extern VOID Framework_Init_Req(IF_FRAMEWORK_INIT_TYPE Type);

typedef VOID (*AppCallback)(VOID);

typedef struct {
    UINT16       NameTextId;
    VOID         *AppImage;    // not free
    AppCallback  AppFunc;      // function to enter APP
} If_Framework_Reg_Info_t;

/**
 * APP register function
 * param (in) RegInfo: If_Framework_Reg_Info_t*
 * return  VOID
 */
extern VOID Framework_App_Register_Req(If_Framework_Reg_Info_t *RegInfo);

/**
 * LCD wakeup or sleep
 * param (in) Wakeup: BOOL
 * return VOID:
 */
extern VOID Framework_Set_Lcd_Status(BOOL Wakeup);

/**
 * Suspend enable or disable
 * param (in) enable: BOOL
 * return VOID:
 */
extern VOID Framework_Set_Suspend_Enable(BOOL Enable);

/**
 * Restart backlight timer
 * param (in) VOID
 * return  VOID
 */
extern VOID Framework_Restart_Backlight_Timer(VOID);

/**
 * Suspend or resume gui task
 * param (in) VOID
 * return  VOID
 */
extern VOID Framework_Suspend(VOID);

/**
 * Update time and date, battery status, charger status, signal bar
 * param (in) VOID
 * return  VOID
 */
extern VOID Framework_Update_Status(BOOL UpdateSignal);

/**
 * LCD wakeup or sleep
 * param (in) VOID
 * return BOOL
 */
extern BOOL Framework_Get_Lcd_Status(VOID);

/**
 * Display status bar
 * param (in) DisplaySignal: BOOL
 * return VOID
 */
extern VOID Framework_Display_Status_Bar(BOOL DisplaySignal);

/**
 * Inform framework to ask user whether to switch on if user selects to stop alarm during power off
 * param (in) VOID
 * return  VOID
 */
extern VOID Framework_Poweroff_Stop_Alarm_Ind(VOID);

/**
 * Set sleep LCD only
 * param (in) Enable: BOOL
 * return VOID
 */
extern VOID Framework_Set_Sleep_Lcd_Only(BOOL Enable);

/**
 * Get phone ready status
 * param (in) VOID
 * return BOOL: TRUE if phone is ready, otherwise FALSE
 */
extern BOOL Framework_Get_Phone_Ready_Status(VOID);

/**
 * Set phone ready status
 * param (in) BOOL: TRUE if phone is ready, otherwise FALSE
 * return VOID
 */
VOID Framework_Set_Phone_Ready_Status(BOOL PhoneReady);

#ifdef __cplusplus
}
#endif

#endif /*INTER_FRAMEWORK_INTERFACE_H*/
